bitkeeper revision 1.1159.223.18 (41f2c6eamwtTkjdrv4CuL1WnOy4iGw)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Sat, 22 Jan 2005 21:34:34 +0000 (21:34 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Sat, 22 Jan 2005 21:34:34 +0000 (21:34 +0000)
Description: use INSTALL everywhere
Use install(by way of INSTALL variables) to create directories, install
programs, and install data files.

From: Adam Heath <doogie@brainfood.com>
Signed-off-by: ian.pratt@cl.cam.ac.uk
Makefile
tools/examples/Makefile
tools/libxc/Makefile
tools/libxutil/Makefile
tools/misc/Makefile
tools/misc/miniterm/Makefile
tools/sv/Makefile
tools/xentrace/Makefile
tools/xfrd/Makefile
xen/Makefile

index 7332978f990c4954500e0205782b1d6a2e7a9583..ecbc022e10673a675b8a4ade4b741c9e18b2c99f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,10 @@
 
 DIST_DIR    ?= $(shell pwd)/dist
 INSTALL_DIR ?= $(DIST_DIR)/install
+INSTALL                := install
+INSTALL_DIR    := $(INSTALL) -d -m0755
+INSTALL_DATA   := $(INSTALL) -m0644
+INSTALL_PROG   := $(INSTALL) -m0755
 
 KERNELS ?= linux-2.6-xen0 linux-2.6-xenU
 # linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU
@@ -35,21 +39,21 @@ install-tools:
        $(MAKE) -C tools install
 
 install-kernels:
-       $(shell cp -a $(INSTALL_DIR)/boot/* /boot/)
-       $(shell cp -a $(INSTALL_DIR)/lib/modules/* /lib/modules/)
-       $(shell cp -dR $(INSTALL_DIR)/boot/*$(LINUX_VER)* $(prefix)/boot/)
-       $(shell cp -dR $(INSTALL_DIR)/lib/modules/* $(prefix)/lib/modules/)
+       cp -a $(INSTALL_DIR)/boot/* /boot/
+       cp -a $(INSTALL_DIR)/lib/modules/* /lib/modules/
+       cp -dR $(INSTALL_DIR)/boot/*$(LINUX_VER)* $(prefix)/boot/
+       cp -dR $(INSTALL_DIR)/lib/modules/* $(prefix)/lib/modules/
 
 install-docs:
        sh ./docs/check_pkgs && $(MAKE) -C docs install || true
 
 # build and install everything into local dist directory
 dist: xen tools kernels docs
-       install -m0644 ./COPYING $(DIST_DIR)
-       install -m0644 ./README $(DIST_DIR)
-       install -m0755 ./install.sh $(DIST_DIR)
-       mkdir -p $(DIST_DIR)/check
-       install -m0755 tools/check/chk tools/check/check_* $(DIST_DIR)/check
+       $(INSTALL_DIR) $(DIST_DIR)/check
+       $(INSTALL_DATA) ./COPYING $(DIST_DIR)
+       $(INSTALL_DATA) ./README $(DIST_DIR)
+       $(INSTALL_PROG) ./install.sh $(DIST_DIR)
+       $(INSTALL_PROG) tools/check/chk tools/check/check_* $(DIST_DIR)/check
 
 xen:
        $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install
index 14f18ae84fc72e82883bebbed330c31248e7b06c..b19b9710bab9362e31678ae753ed2a60dccee538 100644 (file)
@@ -1,3 +1,7 @@
+INSTALL                = install
+INSTALL_DIR    = $(INSTALL) -d -m0755
+INSTALL_PROG   = $(INSTALL) -m0755
+INSTALL_DATA   = $(INSTALL) -m0644
 
 # Init scripts.
 XEND_INITD = init.d/xend
@@ -21,23 +25,23 @@ all:
 install: all install-initd install-configs install-scripts
 
 install-initd:
-       install -d $(prefix)/etc/init.d
-       install -m0755 $(XEND_INITD) $(prefix)/etc/init.d
-       install -m0755 $(XENDOMAINS_INITD) $(prefix)/etc/init.d
+       $(INSTALL_DIR) $(prefix)/etc/init.d
+       $(INSTALL_PROG) $(XEND_INITD) $(prefix)/etc/init.d
+       $(INSTALL_PROG) $(XENDOMAINS_INITD) $(prefix)/etc/init.d
 
 install-configs:
-       install -d $(prefix)$(XEN_CONFIG_DIR)
-       install -d $(prefix)$(XEN_CONFIG_DIR)/auto
+       $(INSTALL_DIR) $(prefix)$(XEN_CONFIG_DIR)
+       $(INSTALL_DIR) $(prefix)$(XEN_CONFIG_DIR)/auto
        for i in $(XEN_CONFIGS); \
            do [ -a $(prefix)/$(XEN_CONFIG_DIR)/$$i ] || \
-           install -m0644 $$i $(prefix)$(XEN_CONFIG_DIR); \
+           $(INSTALL_DATA) $$i $(prefix)$(XEN_CONFIG_DIR); \
        done
 
 install-scripts:
-       install -d $(prefix)$(XEN_SCRIPT_DIR)
+       $(INSTALL_DIR) $(prefix)$(XEN_SCRIPT_DIR)
        for i in $(XEN_SCRIPTS); \
            do [ -a $(prefix)/$()/$$i ] || \
-           install -m0755 $$i $(prefix)$(XEN_SCRIPT_DIR); \
+           $(INSTALL_PROG) $$i $(prefix)$(XEN_SCRIPT_DIR); \
        done
 
 clean:
index c8960c2a51f7181f9f65e9db169605be2ec872b1..c77b5c2767b9141d5e12288393df0980e4c9f049 100644 (file)
@@ -1,3 +1,7 @@
+INSTALL                = install
+INSTALL_PROG   = $(INSTALL) -m0755
+INSTALL_DATA   = $(INSTALL) -m0644
+INSTALL_DIR    = $(INSTALL) -d -m0755
 
 MAJOR          := 2.0
 MINOR          := 0
@@ -64,12 +68,12 @@ mk-symlinks:
          ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
 
 install: all
-       mkdir -p $(prefix)/usr/lib
-       mkdir -p $(prefix)/usr/include
-       install -m0755 $(LIB) $(prefix)/usr/lib
+       $(INSTALL_DIR) $(prefix)/usr/lib
+       $(INSTALL_DIR) $(prefix)/usr/include
+       $(INSTALL_PROG) $(LIB) $(prefix)/usr/lib
        ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/$(LIB_NAME).so.$(MAJOR)
        ln -sf $(LIB_NAME).so.$(MAJOR) $(prefix)/usr/lib/$(LIB_NAME).so
-       install -m0644 xc.h $(prefix)/usr/include
+       $(INSTALL_DATA) xc.h $(prefix)/usr/include
 
 clean:
        rm -rf *.a *.so *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen
index ae1b26ef6bc59c71ae04757c42e84d9dc99d9b26..f5762512248df8f36f86dca5474004fc49957805 100644 (file)
@@ -1,4 +1,9 @@
 XEN_ROOT = ../..
+INSTALL                = install
+INSTALL_DATA   = $(INSTALL) -m0644
+INSTALL_PROG   = $(INSTALL) -m0755
+INSTALL_DIR    = $(INSTALL) -d -m0755
+
 include $(XEN_ROOT)/tools/Make.defs
 
 CC = gcc
@@ -67,8 +72,8 @@ check-for-zlib:
        fi
 
 install: all
-       mkdir -p $(prefix)/usr/lib
-       install -m0755 $(LIB) $(prefix)/usr/lib
+       $(INSTALL_DIR) -p $(prefix)/usr/lib
+       $(INSTALL_PROG) $(LIB) $(prefix)/usr/lib
        ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/$(LIB_NAME).so.$(MAJOR)
        ln -sf $(LIB_NAME).so.$(MAJOR) $(prefix)/usr/lib/$(LIB_NAME).so
 
index 7c20e8d1b03180bff28dc3775b6f3d917b0fe99b..ab67ba819870f5408dfd84b4cc39ca0695814ffa 100644 (file)
@@ -1,3 +1,6 @@
+INSTALL                = install
+INSTALL_PROG   = $(INSTALL) -m0755
+INSTALL_DIR    = $(INSTALL) -d -m0755
 
 XEN_ROOT=../..
 include $(XEN_ROOT)/tools/Make.defs
@@ -20,10 +23,10 @@ all: $(TARGETS)
        $(MAKE) -C miniterm
 
 install: all
-       mkdir -p $(prefix)/usr/bin
-       mkdir -p $(prefix)/usr/sbin
-       install -m0755 $(INSTALL_BIN) $(prefix)/usr/bin
-       install -m0755 $(INSTALL_SBIN) $(prefix)/usr/sbin
+       $(INSTALL_DIR) $(prefix)/usr/bin
+       $(INSTALL_DIR) $(prefix)/usr/sbin
+       $(INSTALL_PROG) $(INSTALL_BIN) $(prefix)/usr/bin
+       $(INSTALL_PROG) $(INSTALL_SBIN) $(prefix)/usr/sbin
        $(MAKE) -C miniterm install
 
 clean:
index 86e1bf0ccf4939142ae8829b53b424c7aa7c58fb..fbe4a5bceede0e925aa5d02c909abd6261426f94 100644 (file)
@@ -1,3 +1,6 @@
+INSTALL                = install
+INSTALL_PROG   = $(INSTALL) -m0755
+INSTALL_DIR    = $(INSTALL) -d -m0755
 
 CC     = gcc
 CFLAGS = -Wall -O3
@@ -6,8 +9,8 @@ TARGET = miniterm
 all: $(TARGET)
 
 install: all
-       mkdir -p $(prefix)/usr/bin
-       install -m0755 $(TARGET) $(prefix)/usr/bin
+       $(INSTALL_DIR) $(prefix)/usr/bin
+       $(INSTALL_PROG) $(TARGET) $(prefix)/usr/bin
 
 clean:
        $(RM) *.o $(TARGET) *~
index 8ae9a93f875c1fdf5fabd79a80242d8f4967f0bf..a285dc15d535084e02168b917391d71ad83a5fc1 100755 (executable)
@@ -1,4 +1,7 @@
-sv_insdir := $(prefix)/var/xen/sv
+sv_insdir      := $(prefix)/var/xen/sv
+INSTALL                = install
+INSTALL_DIR    = $(INSTALL) -d -m0755
+INSTALL_DATA   = $(INSTALL) -m0644
 
 all:
 
@@ -14,17 +17,16 @@ IMAGES      += next.png previous.png finish.png
 
 install:
        # copy XenSV Main.rpy file
-       @mkdir -p $(sv_insdir)
-       @install -m0644 Main.rpy $(sv_insdir)
+       @$(INSTALL_DIR) $(sv_insdir)
+       @$(INSTALL_DATA) Main.rpy $(sv_insdir)
 
        # copy XenSV images
-       @mkdir -p $(sv_insdir)/images
-       @(cd images && install -m0644 $(IMAGES) $(sv_insdir)/images)
+       @($(INSTALL_DIR) $(sv_insdir)/images
+       @(cd images && $(INSTALL_DATA) $(IMAGES) $(sv_insdir)/images)
 
        # copy XenSV stylesheet
-       @mkdir -p $(sv_insdir)/inc
-       @install -m0644 inc/style.css $(sv_insdir)/inc
-       @install -m0644 inc/script.js $(sv_insdir)/inc
+       @$(INSTALL_DIR) $(sv_insdir)/inc
+       @$(INSTALL_DATA) inc/style.css inc/script.js $(sv_insdir)/inc
 
 clean:
 
index 1b13bd9d8be52ec36bf4c2ebf1ef77c1aaa1e980..c2545762a3a9b9301d5d0e57d8a12c818b516f51 100644 (file)
@@ -1,3 +1,7 @@
+INSTALL                = install
+INSTALL_PROG   = $(INSTALL) -m0755
+INSTALL_DIR    = $(INSTALL) -d -m0755
+INSTALL_DATA   = $(INSTALL) -m0644
 
 XEN_ROOT=../..
 include $(XEN_ROOT)/tools/Make.defs
@@ -20,12 +24,12 @@ MAN8     = $(wildcard *.8)
 all: $(BIN)
 
 install: all
-       mkdir -p $(prefix)/usr/bin
-       mkdir -p $(prefix)/usr/man/man1
-       mkdir -p $(prefix)/usr/man/man8
-       install -m0755 $(BIN) $(SCRIPTS) $(prefix)/usr/bin
-       install -m0644 $(MAN1) $(prefix)/usr/man/man1
-       install -m0644 $(MAN8) $(prefix)/usr/man/man8
+       $(INSTALL_DIR) $(prefix)/usr/bin
+       $(INSTALL_DIR) $(prefix)/usr/man/man1
+       $(INSTALL_DIR) $(prefix)/usr/man/man8
+       $(INSTALL_PROG) $(BIN) $(SCRIPTS) $(prefix)/usr/bin
+       $(INSTALL_DATA) $(MAN1) $(prefix)/usr/man/man1
+       $(INSTALL_DATA) $(MAN8) $(prefix)/usr/man/man8
 
 clean:
        $(RM) *.a *.so *.o *.rpm $(BIN)
index 2330d829c4980c263685b8d2eab734bc5d626064..07c17a3f351a9405772abe3ef5edb8ba4b602eed 100644 (file)
@@ -4,6 +4,10 @@
 # Mike Wray <mike.wray@hp.com>
 #============================================================================
 
+INSTALL                = install
+INSTALL_PROG   = $(INSTALL) -m0755
+INSTALL_DIR    = $(INSTALL) -d -m0755
+
 XEN_ROOT  = ../..
 include $(XEN_ROOT)/tools/Make.defs
 
@@ -68,8 +72,8 @@ xfrd: $(XFRD_PROG_OBJ)
 
 .PHONY: install
 install: xfrd
-       mkdir -p $(prefix)/$(XFRD_INSTALL_DIR)
-       install -m 0755 xfrd $(prefix)/$(XFRD_INSTALL_DIR)
+       $(INSTALL_DIR) $(prefix)/$(XFRD_INSTALL_DIR)
+       $(INSTALL_PROG) xfrd $(prefix)/$(XFRD_INSTALL_DIR)
 
 .PHONY: libutil
 libutil: $(UTIL_LIB)
index 7eb1d17847aa1412bc501f6646d5da889e172dc9..28d83684643387aa13f6c52a9e528e4fe74d9fce 100644 (file)
@@ -1,3 +1,6 @@
+INSTALL                        = install
+INSTALL_DATA           = $(INSTALL) -m0644
+INSTALL_DIR            = $(INSTALL) -d -m0755
 
 # This is the correct place to edit the build version.
 # All other places this is stored (eg. compile.h) should be autogenerated.
@@ -18,13 +21,13 @@ debug:
        objdump -D -S $(TARGET)-syms > $(TARGET).s
 
 install: $(TARGET).gz
-       mkdir -p $(prefix)/boot
-       install -m0644 $(TARGET).gz $(prefix)/boot
-       install -m0644 $(TARGET)-syms $(prefix)/boot
-       mkdir -p $(prefix)/usr/include/xen/io
-       install -m0644 include/public/*.h $(prefix)/usr/include/xen
-       install -m0644 include/public/io/*.h $(prefix)/usr/include/xen/io
-       install -m0644 include/public/COPYING $(prefix)/usr/include/xen
+       $(INSTALL_DIR) $(prefix)/boot
+       $(INSTALL_DATA) $(TARGET).gz $(prefix)/boot
+       $(INSTALL_DATA) $(TARGET)-syms $(prefix)/boot
+       $(INSTALL_DIR) $(prefix)/usr/include/xen/io
+       $(INSTALL_DATA) include/public/*.h $(prefix)/usr/include/xen
+       $(INSTALL_DATA) include/public/io/*.h $(prefix)/usr/include/xen/io
+       $(INSTALL_DATA) include/public/COPYING $(prefix)/usr/include/xen
 
 dist: $(TARGET)
        $(MAKE) prefix=`pwd`/../dist/install dist=yes install